/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.schedule.manage.service;


import info.peigen.hotpot.common.core.result.PageResult;
import info.peigen.hotpot.component.schedule.core.repository.service.ScheduleNodeRepository;
import info.peigen.hotpot.component.schedule.core.service.ScheduleNodeService;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleNodeCreateOrder;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleNodeDeleteOrder;
import info.peigen.hotpot.component.schedule.facade.command.order.ScheduleNodeEditOrder;
import info.peigen.hotpot.component.schedule.facade.command.result.ScheduleNodeCreateResult;
import info.peigen.hotpot.component.schedule.facade.command.result.ScheduleNodeDeleteResult;
import info.peigen.hotpot.component.schedule.facade.command.result.ScheduleNodeEditResult;
import info.peigen.hotpot.component.schedule.facade.command.result.info.ScheduleNodeManageInfo;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleNodeManageAddForm;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleNodeManageDeleteForm;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleNodeManageEditForm;
import info.peigen.hotpot.component.schedule.manage.form.ScheduleNodeManageSearchForm;
import info.peigen.hotpot.component.schedule.manage.util.ScheduleNodeManageConvertor;
import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Inject;

/**
 * <b>(ScheduleNodeManageService)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2023/1/6
 */
@SuppressWarnings("AlibabaServiceOrDaoClassShouldEndWithImpl")
@Component
public class ScheduleNodeManageService {
    @Inject
    private ScheduleNodeRepository scheduleNodeRepository;
    @Inject
    private ScheduleNodeService    scheduleNodeService;

    public PageResult<ScheduleNodeManageInfo> page(ScheduleNodeManageSearchForm form) {
        // PageResult<ScheduleNodeManageInfo> page = scheduleNodeRepository.page(form, entity -> ScheduleNodeConvertor.convertToInfo(entity));
        // return page;
        return null;
    }

    public ScheduleNodeCreateResult add(ScheduleNodeManageAddForm form) {
        ScheduleNodeCreateOrder order = ScheduleNodeManageConvertor.convertOrder(form);
        return scheduleNodeService.create(order);
    }

    public ScheduleNodeEditResult edit(ScheduleNodeManageEditForm form) {
        ScheduleNodeEditOrder order = ScheduleNodeManageConvertor.convertOrder(form);
        return scheduleNodeService.edit(order);
    }

    public ScheduleNodeDeleteResult delete(ScheduleNodeManageDeleteForm form) {
        ScheduleNodeDeleteOrder order = ScheduleNodeManageConvertor.convertOrder(form);
        return scheduleNodeService.delete(order);
    }
}